package com.lxq.www.service;

import com.lxq.www.dao.ArticleDao;
import com.lxq.www.pojo.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class ArticleService{
    @Autowired
    ArticleDao articleDao;

    public ArrayList<Article> getPublicAll(){
        return articleDao.getPublicAll();
    }

    public Article getById(String articleId){
        articleDao.visitCountUp(articleId);
        return articleDao.getById(articleId);
    }

    public ArrayList<Article> getPublicAllForList(){
        return articleDao.getPublicAllForList();
    }
}